package com.dmall.opening.up.records.dao.mysql.mybatis.mapper;

import com.dmall.opening.up.core.Criteria;
import com.dmall.opening.up.core.Order;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

public interface OrderMapper {

    int insert(@Param("info") Map<String, Object> info);

    int insertItems(@Param("info") Map<String, Object> info);

    Order findById(@Param("id") Long id);

    long countByCriteria(@Param("criteria") Criteria criteria);

    List<Order> findByCriteria(@Param("criteria") Criteria criteria,
                               @Param("begin") Long begin,
                               @Param("limit") Long limit);

    int cancel(@Param("order") Order order);

    int return_(@Param("item") Order.Item item);

    Order.Item findItemById(@Param("order_id") Long orderId, @Param("item_id") Long itemId);
}
